#include "param.h"

void param_init(param_t *param_ptr)
{
    param_ptr->version_major = 0x01;
    param_ptr->version_minor = 0x00;
    param_ptr->host_id = HOST_ID;
    param_ptr->boot_flag = BOOT2IAP_FLAG;
    fmc_erase(PARAM_ADDR,0x800,1);
    fmc_write(PARAM_ADDR,(uint32_t *)param_ptr,sizeof(param_t)/4);
}

void param_read(param_t *param_ptr)
{
    param_t *ptr = (param_t *)PARAM_ADDR;
    param_ptr->version_major = ptr->version_major;
    param_ptr->version_minor = ptr->version_minor;
    param_ptr->host_id = ptr->host_id;
    param_ptr->boot_flag = ptr->boot_flag;
}
